package parts4.lesson39;

/**
 * 生产者
 */
public class DataProvider implements Runnable {
    private Data data;

    public DataProvider(Data data) {
        this.data = data;
    }

    @Override
    public void run() {
        for (int x = 0; x < 50; x++) {
            if (x % 2 == 0) {
                this.data.set("老李", "是个好人");


            } else {
                this.data.set("民族败类", "是个坏人");

            }
        }
    }
}
